package org.altervista.cp.thinjdbc.ds;

import java.sql.Connection;
import java.sql.SQLException;

import org.altervista.cp.thinjdbc.util.Pool;

public abstract class ConnectionPool extends Pool<Connection> {

	protected abstract void shutdown(Connection c) throws SQLException;

	public void shutdown() {
		synchronized (_pool) {
			for (Connection c : _pool) {
				try {
					shutdown(c);
				} catch (Throwable t) {
				}
			}
		}
	}

	protected void finalize() {
		shutdown();
	}

}
